<?php

  $buildDir = realpath("./__phpackager__");

  $pharFilename = "phpackage.phar";
  if (file_exists($pharFilename)) {
    unlink($pharFilename);
  }

  $pharObject = new Phar($pharFilename);
  $pharObject->buildFromDirectory($buildDir, "/^((?!\.svn).)*$/i");
  $pharObject->setStub(file_get_contents("./stub.php") . "__HALT_COMPILER();");
